<template>
  <div class="LoginText">
    <van-field
      :label="label"
      :placeholder="placeholder"
      :type="type"
      :rule="rule"
      v-model="content"
    />
  </div>
</template>

<script>
export default {
  props: ["label", "placeholder", "type", "rule"],
  data() {
    return {
      content: ""
    };
  },
  methods: {
    TextVerification() {
      // const rule = new RegExp(this.rule);
      // if (rule.test(this.content)) {
      // 当输入正确的时候 把content的值传过去
      this.$emit("inputChang", this.content);
      // }
    }
  },
  watch: {
    content() {
      this.TextVerification();
    }
  }
};
</script>
<style lang="less" scoped>
</style>